1. Field of the Invention
The present invention relates to audio encoding, and more particularly, to an audio encoding method and apparatus capable of fast bit rate control.
2. Description of the Related Art
FIG. 1 is a block diagram of a conventional audio encoding apparatus. Referring to FIG. 1, the audio encoding apparatus includes a T/F converter 100, a psychoacoustic modeling unit 110, a quantization/bit rate controller 120, a lossless encoder 130, and a bit packing unit 140. The T/F converter 100 converts audio PCM data in the time domain into a signal in the frequency domain. The psychoacoustic modeling unit 110 calculates allowed distortion by reflecting the hearing property of a human. The quantization/bit rate controller 120 quantizes the signal in the frequency domain. Here, the quantization step size of the signal in the frequency domain varies depending on the allowed distortion and the number of bits available. In other words, the quantization/bit rate controller 120 allocates more bits in frequency band in which noise is easily audible due to a low allowed distortion and allocates fewer bits in a frequency band in which the allowed distortion is high. The quantization/bit rate controller 120 performs bit allocation necessary for each frequency band and quantization by adjusting a scalefactor value based on an encoding target bit rate and the allowed distortion of a psychoacoustic model.
FIG. 2 is a block diagram of the quantization/bit rate controller 120 shown in FIG. 1. Referring to FIG. 2, the quantization/bit rate controller 120 includes a distortion controller 200 and a bit rate controller 250.
The distortion controller 200 determines a scalefactor value in each quantization band so as to be suitable for the allowed distortion. The scalefactor value is determined in each scalefactor band and used to quantize frequency domain data in each scalefactor band.
The bit rate controller 250 determines a common scalefactor value used in quantization of the whole frequency band to be suitable for the encoding target bit rate and includes an sf(scalefactor) increase calculator 256, a quantizer 252, and a used bits calculator 254.
The common scalefactor is applied to the whole scalefactor bands and used for quantizing the audio data. Here, the scalefactor value is determined in each scalefactor band starting from the common scalefactor value so as to satisfy the allowed distortion.
The sf increase calculator 256 predicts a final common scalefactor value for the common scalefactor value. The quantizer 252 performs quantization using the calculated common scalefactor value. The used bits calculator 254 calculates the number of bits used for lossless encoding quantized sample data.
FIG. 3 illustrates the operational complexity of each module of the audio encoding apparatus of FIG. 1. As shown in FIG. 3, the complexity of the quantization/bit rate controller 120 occupies more than 50% in the whole audio encoding process and thus it is high. The complexity of the bit rate controller 250 is high due to a repeated loop for searching an optimum common scalefactor value satisfying restrictions of the encoding target bit rate and the allowed distortion.